package today.rocky.boot.quartz;

import com.alibaba.druid.pool.DruidDataSource;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.quartz.QuartzDataSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;

import javax.sql.DataSource;


/**
 * @author Rocky
 */
@SpringBootApplication
@MapperScan("today.rocky.boot.quartz.mapper")
public class BootQuartzApplication {

    public static void main(String[] args) {
        SpringApplication.run(BootQuartzApplication.class, args);
    }

    @Primary
    @Bean
    @ConfigurationProperties(prefix = "spring.datasource.dynamic.datasource.master")
    public DruidDataSource druidDataSource() {
        return new DruidDataSource();
    }


}
